/*
 * This file is used to test BPM
 */

package mycode;

//import javax.swing.JTextField;

import org.netbeans.jemmy.*;
//import org.netbeans.jemmy.explorer.*;
import org.netbeans.jemmy.operators.*;
//import com.barra.*;

public class WaitWindowSample implements Scenario {
    @Override
	public int runIt(Object param) {
	try {
	    //start application
	    new ClassReference("org.netbeans.jemmy.explorer.GUIBrowser").startApplication();
	    //wait frame
	    new JFrameOperator("GUI Browser");
	    Thread.sleep(100000);
	} catch(Exception e) {
	    e.printStackTrace();
	    return(1);
	}
	return(0);
    }
    public static void main(String[] argv) {
//    	String[] params = {"mycode.WaitWindowSample"};
//    	org.netbeans.jemmy.Test.main(params);
    	
    	try {
    	    //start application
    	    new ClassReference("com.barra.cp.bpm.application.BpmApplication").startApplication();
    	    //wait frame
    	    JFrameOperator loginframe = new JFrameOperator();
//    	    JLabelOperator labelOper = new JLabelOperator(loginframe, "User ID");
//    	    JTextFieldOperator testField = new JTextFieldOperator((JTextField)labelOper.getLabelFor());
    	    JTextFieldOperator testField = new JTextFieldOperator(loginframe,0);
    	    testField.clearText();
   		 	testField.typeText("selenium1");
    	    JTextFieldOperator testField1 = new JTextFieldOperator(loginframe,1);
    	    testField1.clearText();
   		 	testField1.typeText("temp1234");
    	    JTextFieldOperator testField3 = new JTextFieldOperator(loginframe,2);
    	    testField3.clearText();
   		 	testField3.typeText("qs9biu4q66");
   		    new JButtonOperator(loginframe, "Log in").push();
   		 	
    	} catch(Exception e) {
    	    e.printStackTrace();
    	}
    }
}

